#include"../include/dfa.h"
#include<queue>


using namespace std;
void TranverseAndNameNfa(NFA&nfa){
    int idx=0;
    queue<State*>q;
    q.push(nfa.initial);
    while(!q.empty()){
        State*s=q.front();
        q.pop();
        if(s->id!=-1)continue;
        s->id=idx;
        if(s->edge1!=nullptr)
            q.push(s->edge1);
        if(s->edge2!=nullptr)
            q.push(s->edge2);
        debug("idx %d\n", idx);
        idx+=1;   
    }
}

void InitDFA(){
    for(int i=0;i<N;i++){
        DFA[i].idx=i;
    }
}

void BuildNaiveDFA(){
    for(int row=0;row<dfaStateTable.size();row++){
        for(int col=0; col<dfaStateTable[row].size();col++){
            DFA[row][col]=dfaStateTable[row][col];
        }
    }
}

void DeleteUnreachableNode(){

}

void BuildDFA(){
    InitDFA();
}
